<extend name="Public/base"/>

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>银行卡认证</h2>
	</div>

    <div class="cf">
        <div class="fl">

        </div>
        <php>
            $QIANBAO_AUTH_STATUS = C('QIANBAO_AUTH_STATUS');
            $status = I('get.status','');
        </php>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <div class="drop-down" style="width: 150px;">
                    <if condition="$status eq ''">
                        <span id="sch-sort-txt"  style="width: 115px;" class="sort-txt" data="">所有</span>
                        <else/>
                        <span id="sch-sort-txt"  style="width: 115px;" class="sort-txt" data="{$status}">{$QIANBAO_AUTH_STATUS[$status]}</span>
                    </if>


                    <i class="arrow arrow-down"></i>
                    <ul id="sub-sch-menu" class="nav-list hidden">
                        <li><a href="javascript:;" style="width: 115px;" value="">所有</a></li>
                        <foreach name="QIANBAO_AUTH_STATUS" item="vo" >
                            <li><a href="javascript:;" style="width: 115px;" value="{$key}">{$vo}</a></li>
                        </foreach>
                    </ul>
                </div>
                <input name="title" class="search-input" value="{:I('get.title','')}" placeholder="请输入开户名字、用户UID" type="text">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('bank')}"><i class="btn-search"></i></a>
            </div>

        </div>
    </div>
	<!-- 数据列表 -->
	<div class="data-table">
	<table class="">
    <thead>
        <tr>

		<th class="">用户UID</th>
		<th class="">开户名字</th>
		<th class="">开户银行</th>
		<th class="">银行卡号</th>
		<th class="">预留号码</th>
         <th class="">状态</th>
            <th style="width: 150px;" class="">操作</th>
		</tr>
    </thead>
    <tbody>
		<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>

			<td>{$vo.uid} </td>
			<td>{$vo.name}</td>
			<td>{$vo.openbank}</td>
			<td>{$vo.card_number}</td>
			<td>{$vo.mobile}</td>
            <td>{:C('QIANBAO_AUTH_STATUS.'.$vo[status])}</td>
            <td>

                <a class="ajax-get" href="{:U('change?type=bank&method=2&id='.$vo['uid'])}">通过</a>
                &nbsp;&nbsp;
                <a class="ajax-get" href="{:U('change?type=bank&method=3&id='.$vo['uid'])}">不通过</a>
                &nbsp;&nbsp;
                <a href="{:U('bankupdate?id='.$vo['id'])}">修改</a>
                <a id="delete" href="#" h="{:U('bankdelete?id='.$vo['id'])}">删除</a>
            </td>

		</tr>
		</volist>
		<else/>
		<td colspan="7" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>
	</div>
	<!-- 分页 -->
	<div class="page">{$_page}</div>
	<!-- /分页 -->

</block>
<block name="script">
<script type="text/javascript">
    highlight_subnav('{:U('Authentication/bank')}');
    $(function(){
        //搜索功能
        $('#delete').click(function(){
            var url=$(this).attr('h');
            $.ajax({
                type:'get',
                url:url,
                success:function(m){
                    alert(m)
                    location.reload();
                }
            })
            return false;
        })


        $("#search").click(function(){
            var url = $(this).attr('url');
            var status = $("#sch-sort-txt").attr("data");
            var query  = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            if(status != ''){
                query += '&status=' + status + "&" + query;
            }
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            window.location.href = url;
        });

        /* 状态搜索子菜单 */
        $(".search-form").find(".drop-down").hover(function(){
            $("#sub-sch-menu").removeClass("hidden");
        },function(){
            $("#sub-sch-menu").addClass("hidden");
        });
        $("#sub-sch-menu li").find("a").each(function(){
            $(this).click(function(){
                var text = $(this).text();
                $("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
                $("#sub-sch-menu").addClass("hidden");
            })
        });


    })




        // $.ajax({
        //       type:'get',
        //       url:"{:U('test/zhengdian')}",
        //       success:function(m){
        //         alert(m)
        //       }
        // })

</script>
</block>
